#ifndef _GOVT_COMBAT_HPP_
#define	_GOVT_COMBAT_HPP_
/*******************************************************************************
 ** Government Sanctioned Espionage RPG Server                                **
 ** http://www.government-sanctioned.us/                                      **
 **===========================================================================**
 ** Name: combat.hpp                                                          **
 ** Description: Combat support.                                              **
 **                                                                           **
 ** Open Source Initiative (OSI) Approved License                             **
 **                                                                           **
 ** The contents of this file are subject to the terms of the                 **
 ** Common Development and Distribution License, Version 1.0 only             **
 ** (the "License").  You may not use this file except in compliance          **
 ** with the License.                                                         **
 **                                                                           **
 ** You can find a copy of the license in the LICENSE file within             **
 ** this distribution or at $WIKI/display/GOVT/License-software.              **
 ** Software distributed under the License is distributed on an "AS IS"       **
 ** basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.           **
 ** See the License for the specific language governing permissions           **
 ** and limitations under the License.                                        **
 **                                                                           **
 ** When distributing Covered Code, include this CDDL header in each          **
 ** file and include the License file at $GAME_DIR/LICENSE.                   **
 ** If applicable, add the following below this header, with the indicated    **
 ** fields enclosed by brackets "[]" replaced with your own identifying       **
 ** information: Portions Copyright [yyyy] [name of copyright owner]          **
 **                                                                           **
 ** Copyright (c) 2009-2012  Open Design Strategies, LLC                      **
 ** All rights reserved.                                                      **
 ******************************************************************************/
// Created on March 18, 2010, 2:25 AM
// Modified $Date$ by $Author$
#define combat_hpp_ID   "$Id$"

#include <string>
#include "common.hpp"
#include <list>


// Fumbles, etc


// Hit locations
#pragma db object table("hitloc")
struct hitloc_t {
	#pragma db id auto
	entity_t		idhitloc_;
    std::string     loc_;
    float           dmg_mod_; //!< ie dmg *.5 or dmg * 1.5, etc
    int				attack_mod_;
    
};

//! struct to keep track of initiative
struct InitiativeRolls
{
	entity_t	player;		//! id of player
	int			roll;

	bool operator < (const InitiativeRolls & o) const {
		return roll < o.roll;
	}
};

//! @class CombatManager
//! @brief Created for each combat action
class CombatManager
{
public:
	void	BeginCombat();
	void	EndCombat();
	void	RollInitiative();
	void	EnterCombat(entity_t c) { combatants.push_back(c); }
	void	LeaveCombat(entity_t c);
	void	ProcessAction(entity_t c);
private:
	std::list<entity_t>	combatants;
	std::list<InitiativeRolls> init;	// sorted
};


#endif	/* _COMBAT_HPP_ */

